Skip to content

fix: tools-call-simple-text now fails when tool returns isError: true#165

Open
lux999 wants to merge 3 commits intomodelcontextprotocol:mainfrom
lux999:fix/tools-call-simple-text-iserror-check
Open

fix: tools-call-simple-text now fails when tool returns isError: true#165
lux999 wants to merge 3 commits intomodelcontextprotocol:mainfrom
lux999:fix/tools-call-simple-text-iserror-check

Conversation

@lux999
Copy link
Copy Markdown

@lux999 lux999 commented Feb 24, 2026

Added an isError check to ToolsCallSimpleTextScenario, so the test tools-call-simple-text correctly fails when the tool returns an error result instead of a successful text response.

Motivation and Context

The test tools-call-simple-text was passing for servers that don't implement test_simple_text at all.
When an unknown tool is called, MCP frameworks return { isError: true, content: [{ type: "text", text: "Tool not found: ..." }] }. The existing assertions only checked for a non-empty text content item, which the "Tool not found" error message satisfies. The missing assertion was that result.isError must not be true.

How Has This Been Tested?

Verified against the existing everything-server reference implementation, which correctly implements test_simple_text and continues to pass. Confirmed that servers without test_simple_text now correctly fail the test.

Breaking Changes

Servers that were previously passing tools-call-simple-text without implementing test_simple_text will now correctly fail.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

pcarleton
pcarleton previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Member

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@pcarleton pcarleton enabled auto-merge (squash) March 25, 2026 12:10
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

npx https://pkg.pr.new/@modelcontextprotocol/conformance@165

commit: cd062a6

auto-merge was automatically disabled April 19, 2026 20:13

Head branch was pushed to by a user without write access

The reference everything-server's zod schema rejects `undefined` arguments
and requires at least `{}`, so omitting `arguments` caused the server to
return `isError: true` with a validation error. This went unnoticed under
the previous lenient check but is correctly flagged by the new `isError`
assertion. Matches the convention used by every other tool-call scenario
in this file.
@lux999 lux999 force-pushed the fix/tools-call-simple-text-iserror-check branch from 04febed to 3af5ac4 Compare April 19, 2026 20:41
@lux999
Copy link
Copy Markdown
Author

lux999 commented Apr 19, 2026

Hi @pcarleton, thanks for the approval!

Quick heads-up on the new commit: after merging main, CI caught one test failure. This scenario originally omitted arguments since they're not required for test_simple_text, but the upstream SDK server rejects undefined arguments against any inputSchema and returns isError: true - which the new check correctly flags. There's an upstream fix in typescript-sdk#1404 but it wasn't backported to 1.x - see typescript-sdk#1869.

I squashed a small workaround into the fix commit: pass arguments: {} explicitly, with an inline comment linking to the SDK issue. Matches the convention in the sibling tool-call scenarios. Happy to revisit if you'd prefer a different approach.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants